package com.lvchuang.service;

import com.lvchuang.mapper.NewsMapper;
import com.lvchuang.model.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewsService {
    @Autowired
    private NewsMapper newsMapper;

    public List<News> selectAll() {
        return newsMapper.selectAll();
    }

    public void insertNews(News news) {
        newsMapper.insertNews(news);
    }

    public void deleteNews(Integer id) {
        newsMapper.deleteNews(id);
    }

    public News selectById(int id) {
        return newsMapper.selectById(id);
    }

    public void updateNewsByNews(News news) {
        newsMapper.updateNewsByNews(news);
    }
}
